<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        #app{
            width: 1500px;
            height: 500px;
        }
        .left{
            width: 375px;
            height: 480px;
            float: left;
        }
        .left>img{
            width: 375px;
            height: 480px;
        }
        .right{
            float: left;
            width: 1000px;
        }
        .right div{
            width: 150px;
            height: 250px;
            float: left;
            
        }
        .right img{
            width:220px;
            display: block;
        }
        ul{
            float: left;
        }
        li{
            list-style: none;
            float: left;
            height: 250px;
            margin: 0;
            padding: 0;
            margin-right: 10px;
        }
        p{
            font-size: 12px;
            text-align: center;
        }
        h3{
            text-align: center;
            color: red;
        }
    </style>
</head>
<body>
    <div id="app">
        <div class="left">
            <child1></child1>
        </div>
        <div class="right">
            <child2 :list="list"></child2>
        </div>

    </div>
    <script src="../vue.js"></script>
    <script>
        let child1 = {
            template:`<img :src="img">`,
            data(){
                return{
                    img:"./img/dijia.jpg"
                }
            }
        };
        let child2= {
            props:["list"],
            template:`<ul>
                    <li v-for="item in list">
                        <img :src="item.img">
                        <p>{{item.text1}}</p>
                        <p>{{item.text2}}</p>
                        <h3>{{item.price}}</h3>
                    </li>
                    </ul>`,
        };
        new Vue({
            el:"#app",
            data:{
                
                    list:[
                    {   
                        img:'./img/d1.jpg',
                        text1:"法族高速u盘512g手",
                        text2:"机电脑两用车载防水",
                        price:"$99"
                    },
                    {   
                        img:'./img/d2.jpg',
                        text1:"法族高速u盘512g手",
                        text2:"机电脑两用车载防水",
                        price:"$99"
                    },
                    {   
                        img:'./img/d3.jpg',
                        text1:"法族高速u盘512g手",
                        text2:"机电脑两用车载防水",
                        price:"$99"
                    },
                    {   
                        img:'./img/d4.jpg',
                        text1:"法族高速u盘512g手",
                        text2:"机电脑两用车载防水",
                        price:"$99"
                    },
                    {   
                        img:'./img/d4.jpg',
                        text1:"法族高速u盘512g手",
                        text2:"机电脑两用车载防水",
                        price:"$99"
                    },
                    {   
                        img:'./img/d3.jpg',
                        text1:"法族高速u盘512g手",
                        text2:"机电脑两用车载防水",
                        price:"$99"
                    },
                    {   
                        img:'./img/d2.jpg',
                        text1:"法族高速u盘512g手",
                        text2:"机电脑两用车载防水",
                        price:"$99"
                    },
                    {   
                        img:'./img/d1.jpg',
                        text1:"法族高速u盘512g手",
                        text2:"机电脑两用车载防水",
                        price:"$99"
                    },
                    
                ]
            },
            components:{
                child1,
                child2
            }
        })
        
    </script>
</body>
</html>